﻿namespace Offy.Itdev.BuyIn.Intranet.Core.Impl
{
    using Microsoft.SharePoint;
    using Constant;
    using Repositories;
    using Contracts;
    using DTO;

    public class ProductCategoryDAL : BaseDao<ProductCategoryDTO>, IProductCategoryDAL
    {
        public ProductCategoryDAL() : base(SPContext.Current.Web, Lists.Product) { }

        public ProductCategoryDAL(SPWeb web) : base(web, Lists.Product) { }

        public ProductCategoryDTO Get(int id)
        {
            return base.GetById(id);
        }

        protected override ProductCategoryDTO MapDTO(SPListItem item)
        {
            var entity = new ProductCategoryDTO();
            entity.ID = item.ID;
            entity.Title = item.Title;
            return entity;
        }
    }
}
